import Layout from '@/layout/index'


let dbRouter=[]

let complateRouter = function(){

  for (let i = 0; i < constantRoutes.length; i++) {

    //判断是否有子节点
    if(constantRoutes[i].children){
      dbRouter.push(1)
    }else{

    }

  }



}


export const constantRoutes = [

  {
    'id': 1, 'name': '登录','fid':'-1', 'obj': {
      path: '/login',
      component: () => import('@/views/login/index'),
      hidden: true
    }
  },

  {
    'id': 2, 'name': '报错', 'fid':'-1','obj': {
      path: '/404',
      component: () => import('@/views/404'),
      hidden: true
    }
  },

  {
    'id': 3, 'name': '首页', 'fid':'-1','obj': {
      path: '/',
      component: Layout,
      redirect: '/dashboard',
      children: [
        {
          path: 'dashboard',
          component: () => import('@/views/dashboard/index'),
          name: 'Dashboard',
          meta: { title: '首页', icon: 'dashboard', affix: true }
        }
      ]
    }
  },

  //-----租户管理
  {
    'id': 4, 'name': '租户管理','fid':'-1', 'obj': {
      path: '/tenant',
      component: Layout,
      // redirect: '/tenant',
      children: [{
        path: 'tenant',
        name: 'Tenant',
        component: () => import('@/views/tenant/index'),
        // meta: { title: 'Dashboard', icon: 'dashboard' }
        meta: { title: '租户管理', icon: 'table' }
      }]
    }
  },

  //-----校务管理
  {
    'id': 5, 'name': '校务管理','fid':'-1', 'obj': {
      path: '/schoolmgt',
      component: Layout,
      redirect: 'noRedirect',
      meta: { title: '校务管理', icon: 'school' },
      children: []
    }
  },

  {
    'id': 6, 'name': '学生管理','fid':'5', 'obj': {
      path: 'students',
      name: 'Students',
      component: () => import('@/views/schoolmgt/students'),
      meta: { title: '学生信息', icon: 'students' }
    }
  },

  {
    'id': 7, 'name': '教师管理','fid':'5', 'obj': {
      path: 'teachers',
      name: 'Teachers',
      component: () => import('@/views/schoolmgt/teachers'),
      meta: { title: '教师管理', icon: 'teachers' }
    }
  },

  {
    'id': 8, 'name': '年级管理','fid':'5', 'obj': {
      path: 'grade',
      name: 'Grade',
      component: () => import('@/views/schoolmgt/grades'),
      meta: { title: '年级管理', icon: 'grade' }
    }
  },

  //-----视频管理
  {
    'id': 9, 'name': '视频管理', 'fid':'-1','obj': {
      path: '/videomgt',
      component: Layout,
      children: [
        {
          path: 'index',
          name: 'Videomgt',
          component: () => import('@/views/videomgt/index2'),
          // path: 'http://ys.vlab2.chinamcloud.com/',
          meta: { title: '视频管理', icon: 'link' }
        }
      ]
    }
  },

  //-----系统管理
  {
    'id': 10, 'name': '系统管理', 'fid':'-1','obj': {
      path: '/basicmgt',
      component: Layout,
      // redirect: '/basicmgt',
      redirect: 'noRedirect',
      // alwaysShow: true,
      meta: { title: '系统管理', icon: 'nested' },
      children: []

      // children: [
      //   {
      //     path: 'menu1',
      //     component: () => import('@/views/nested/menu1/index'), // Parent router-view
      //     name: 'Menu1',
      //     meta: { title: 'Menu1' },
      //     children: [
      //       {
      //         path: 'menu1-1',
      //         component: () => import('@/views/nested/menu1/menu1-1'),
      //         name: 'Menu1-1',
      //         meta: { title: 'Menu1-1' }
      //       },
      //       {
      //         path: 'menu1-2',
      //         component: () => import('@/views/nested/menu1/menu1-2'),
      //         name: 'Menu1-2',
      //         meta: { title: 'Menu1-2' },
      //         children: [
      //           {
      //             path: 'menu1-2-1',
      //             component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
      //             name: 'Menu1-2-1',
      //             meta: { title: 'Menu1-2-1' }
      //           },
      //           {
      //             path: 'menu1-2-2',
      //             component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
      //             name: 'Menu1-2-2',
      //             meta: { title: 'Menu1-2-2' }
      //           }
      //         ]
      //       },
      //       {
      //         path: 'menu1-3',
      //         component: () => import('@/views/nested/menu1/menu1-3'),
      //         name: 'Menu1-3',
      //         meta: { title: 'Menu1-3' }
      //       }
      //     ]
      //   },
      //   {
      //     path: 'menu2',
      //     component: () => import('@/views/nested/menu2/index'),
      //     meta: { title: 'menu2' }
      //   }
      // ]
    }
  },

  {
    'id': 11, 'name': '基础配置', 'fid':'10','obj': {
      path: 'base',
      name: 'Base',
      component: () => import('@/views/basicmgt/base/index'),
      meta: { roles: ['admin'], title: '基础配置', icon: 'tree' }
    }
  },

  {
    'id': 12, 'name': '套餐设置', 'fid':'10','obj': {
      path: 'order',
      name: 'Order',
      component: () => import('@/views/basicmgt/order/order'),
      meta: { roles: ['admin'], title: '套餐设置', icon: 'money' }
    }
  },

  {
    'id': 13, 'name': '用户管理','fid':'10', 'obj': {
      path: 'usermgt',
      name: 'Usermgt',
      redirect: 'noRedirect',
      component: () => import('@/views/basicmgt/usermgt'),
      // component: Layout,
      meta: { title: '用户管理', icon: 'peoples' },
      children: []
    }
  },

  {
    'id': 14, 'name': '用户列表', 'fid':'13','obj': {
      path: 'consumer',
      name: 'Consumer',
      component: () => import('@/views/basicmgt/usermgt/consumer'),
      meta: { title: '用户列表', icon: 'user' }
    }
  },

  {
    'id': 15, 'name': '角色管理', 'fid':'13','obj': {
      path: '/role',
      name: 'Role',
      component: () => import('@/views/permission/role'),
      meta: { title: '角色管理', icon: 'lock' }
    }
  },

  //微门户
  {
    'id': 16, 'name': '微门户','fid':'-1', 'obj': {
      path: '/viewmin',
      component: Layout,
      children: [
        {
          path: 'index',
          name: 'Viewmin',
          component: () => import('@/views/viewmin/index'),
          //path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
          meta: { title: '微门户', icon: 'component' }
        }
      ]
    }
  },

  //-----统计分析
  {
    'id': 17, 'name': '统计分析','fid':'-1', 'obj': {
      path: '/dataview',
      component: Layout,
      redirect: '/',
      name: 'Dataview',
      // meta: { title: 'dataview', icon: 'example' },
      children: [
        {
          path: 'index',
          component: () => import('@/views/dataview/index'),
          meta: { title: '统计分析', icon: 'example' }
        }
      ]
    }
  },

  // 404 page must be placed at the end !!!
  { 'id': 18, 'name': '404','fid':'-1', 'obj': { path: '*', redirect: '/404', hidden: true } }

]



